import time
from threading import Thread


def work1(name,age):
    for i in range(5):
        time.sleep(1)
        print(f'work--{name}在打孔--今年{age}岁了')

class MyThread(Thread):
    def __init__(self,name,age):
        super().__init__()
        self.name=name
        self.age=age
    def run(self):
        for i in range(10):
            time.sleep(0.1)
            print(f"第{i}次请求")


if __name__ == '__main__':
    Thread(target=work1,kwargs={'name':'张三','age':18}).start()
    # 自定义线程类传递参数，需要重写init方法，在init方法中保存参数即可
    t1=MyThread(name='张三',age=18)
    t1.start()